<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body>

<div th:fragment="header">

    <div class="nav" style="height:80px;
       line-height:80px;
       background:#ededed;
       border-radius:0 0 15px 15px;">
        <div sec:authorize="isAnonymous()">
            <label style="float:left; width:70px; text-align:center;"><a th:href="@{/auth/login}">Login</a></label>
            <label style="float:left; width:70px; text-align:center;"><a th:href="@{/registration}">Register</a></label>
        </div>
        <div sec:authorize="isAuthenticated()">
            <label style="float:left; width:70px; text-align:center;">
                <a th:href="@{/home}">Home</a>
            </label>
            <label style="float:left; width:70px; text-align:center;">
                <a href="" data-toggle='modal' data-target='#myModal' id='logout'>Logout</a>
            </label>
        </div>
    </div>

    <div class="modal fade" role="dialog" id="myModal">
        <div class="modal-dialog">

            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">Warning!</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div>
                <div class="modal-body">
                    <p>Do you want to logout?</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="button" class="btn btn-ok btn-danger"><a th:href="@{/auth/logout}">Yes</a></button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>